<% result ||= report_element.result %>
<% result_text = element.orderable %>
<% timestamp = element.created_at %>
<% export_all = defined?(export_all) && export_all %>
<div class="report-element report-result-element report-result-text-element">
  <div class="report-element-header">
    <div class="text-name">
      <% if result_text.name.present? %>
        <em>
          <%= truncate(result_text.name, length: Constants::FILENAME_TRUNCATION_LENGTH) %>
        </em>
      <% end %>
    </div>
    <% unless @settings['exclude_timestamps'] %>
      <div class="user-time">
        <%= t("projects.reports.elements.result_text.user_time", timestamp: l(timestamp, format: :full)) %>
      </div>
    <% end %>
  </div>
  <div class="report-element-body">
    <div class="row">
      <div class="col-xs-12">
        <div class="text-container ql-editor">
          <%= custom_auto_link(result_text.prepare_for_report(:text, export_all: export_all),
                                team: current_team,
                                simple_format: false,
                                tags: %w(img),
                                base64_encoded_imgs: true) %>
        </div>
      </div>
    </div>
  </div>
  <% if defined?(children) %>
    <div class="report-element-children">
      <%= children %>
    </div>
  <% end %>
</div>
